翻訳と辞書
Words near each other
・ Double-balloon enteroscopy
・ Double-banded courser
・ Double-banded greytail
・ Double-banded plover
・ Double-banded pygmy tyrant
・ Double-banded sandgrouse
・ Double-barred finch
・ Double-barreled cannon
・ Double-barreled question
・ Double-barreled shotgun
・ Double-barrelled name
・ Double-Blind FROG
・ Double-Booked
・ Double-breasted
・ Double-chance function
Double-checked locking
・ Double-clad fiber
・ Double-click
・ Double-collared
・ Double-collared seedeater
・ Double-contrast barium enema
・ Double-crested cormorant
・ Double-Cross (2014 film)
・ Double-Cross System
・ Double-dead meat
・ Double-deck aircraft
・ Double-deck elevator
・ Double-decker bus
・ Double-decker tram
・ Double-density compact disc


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Double-checked locking : ウィキペディア英語版
Double-checked locking
In software engineering, double-checked locking (also known as "double-checked locking optimization"〔Schmidt, D et al. Pattern-Oriented Software Architecture Vol 2, 2000 pp353-363〕) is a software design pattern used to reduce the overhead of acquiring a lock by first testing the locking criterion (the "lock hint") without actually acquiring the lock. Only if the locking criterion check indicates that locking is required does the actual locking logic proceed.
The pattern, when implemented in some language/hardware combinations, can be unsafe. At times, it can be considered an anti-pattern.〔David Bacon et al. (The "Double-Checked Locking is Broken" Declaration ).〕
It is typically used to reduce locking overhead when implementing "lazy initialization" in a multi-threaded environment, especially as part of the Singleton pattern. Lazy initialization avoids initializing a value until the first time it is accessed.
== Usage in C++11 ==
For the singleton pattern, double-checked locking is not needed:

Singleton& instance()

Use C++11 acquire and release fences as given by 〔 (Double-Checked Locking is Fixed In C++11 )〕

std::atomic*> Singleton::m_instance;
std::mutex Singleton::m_mutex;
Singleton
* Singleton::getInstance()
return tmp;
}


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Double-checked locking」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.